package com.bkck.sharkblockade.highscores;

import java.util.Calendar;

/**
 * Score class.
 * 
 * @author BKCK
 *
 */
public class Score implements Comparable<Score> {
	long score;
	String name;
	long timestamp;
	int level;
	
	public Score (String name, long score, int level) {
		this.score = score;
		this.name = name;
		this.level = level;
		this.timestamp = Calendar.getInstance().getTimeInMillis();
	}
	
	public Score (String name, long score, long timestamp, int level) {
		this.score = score;
		this.name = name;
		this.level = level;
		this.timestamp = timestamp;
	}


	public long getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}
	
	public int getLevel() {
		return level;
	}
	
	public void setLevel(int level) {
		this.level = level;
	}

	/**
	 * Comparator method to compare scores.
	 */
	public int compareTo(Score otherScore) {
		Long thisScore = new Long(this.getScore());
		return thisScore.compareTo(new Long(otherScore.getScore()));
	}
} // End Score Class
